#include <iostream>
using namespace std;
template <class numtype>
class Compare {
private:
    numtype x;
    numtype y;
public:
    Compare(numtype a);
    Compare(numtype a, numtype b) {
        x = a;
        y = b;
    }
    numtype max() {
        return (x > y)? x : y;
    }
    numtype min() {
        return (x > y)? y : x;
    }
};
//在类模板外定义成员函数 需要再定义一遍
template <class numtype>
Compare<numtype>::Compare(numtype a){



}

int main() {
    //使用  类模板名<实际类型名> 对象名(实参列表)
    Compare<int> com(3, 7);
    cout << com.max() << endl;
    Compare<double> c(4, 3.1);
    cout << c.max() << endl;
    Compare<char> c1('a', 'b');
    cout << c1.max() << endl;


    return 0;
}